/*
 * CAnimationCollection.h
 *
 *  Created on: 06.01.2012
 *      Author: Kirill Blinov
 *      Copyright: LGPL
 */

#ifndef CANIMATIONCOLLECTION_H_
#define CANIMATIONCOLLECTION_H_

#include "CAnimationController.h"
#include "../BasicTypes.h"

struct CollectionControllerState
{
	CollectionControllerState() : controller(NULL), deleteController(false)
	{}
	std::list<CAnimationController*>::iterator controller;
	bool                                       deleteController;
};

class CAnimationCollection
{
private:
	std::list<CAnimationController*> controllers;
	CollectionControllerState        currentMoving;
	CollectionControllerState        currentRotation;

private:
	void StopBuiltinAnimation( CollectionControllerState& Controller );

public:
	CAnimationCollection();
	virtual ~CAnimationCollection();
	void Animate( IAnimationPlayer* Player, UNIT_PHYSIC_PARAMS* PhysicParams );

	bool PlayAnimation( const UINT AnimationID, const float Speed, const bool Cyclic );
	void Rotate( const float Angle, const glm::vec3 Axis );
	void StopRotation( );
	void Move( const float Acceleration, const glm::vec3 Direction );
	void SetSpeed( const float speed );
	void StopMoving();
};

#endif /* CANIMATIONCOLLECTION_H_ */
